<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->title;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<!--时间选择器-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/lang/cn_utf8.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-setup.js"></script>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-blue.css" />
<!--colorbox-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>


<style>
select{ font-size:12px;}
.event-note { width:390px; height:190px; border:#F3A966 1px dashed; background:#FFFFDF; padding:5px;}
.reportTable td{ max-width:600px;word-wrap: break-word; word-break: normal; }
.resultNote div{ float:left;}
.error { background:red;}
.right { background:green;}
</style>

</head>
<body style="overflow:auto;">
<div id="main">
	<div id="topMenu">
		<div id="navigation">当前位置：<?php echo $this->title;?></div>
		<div id="topOtherMenu"></div>
	</div>
	<div id="body">
		<div id="search">
			<form id="searchForm" name="searchForm" method="post" action="<?php echo $this->projectUrl(array('action'=>'index'));?>">	
<table width="100%" border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td width="50%">
				
			<table width="500" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="100" align="right">开发环境：</td>
                <td width="200" align="left">
				<select name="expType" id="expType">
                    <option value="test" <?php if($this->vars['expType']=='test'){?>selected="selected"<?php }?>>测试</option>
                    <option value="v1.0" <?php if($this->vars['expType']=='v1.0'){?>selected="selected"<?php }?>>正式</option>
                </select></td>
                <td width="200" ><span id="sp_expType">*</span></td>
              </tr>
              <tr>
                <td align="right">日期选择：</td>
                <td align="left"><input name="startTime" type="text" class="input" id="startTime" size="10" value="<?php echo $this->vars['startTime'];?>" />
                  <script type="text/javascript">Calendar.setup({"ifFormat":"%Y-%m-%d","firstDay":0,"showsTime":true,"showOthers":false,"timeFormat":24,"inputField":"startTime","button":"startTime"});</script></td>
                <td ><span id="sp_startTime">*</span></td>
              </tr>
              <tr>
                <td align="right">操作系统：</td>
                <td align="left"><select name="osName" id="osName">
                    <option value="">请选择</option>
                    <?php foreach($this->osNameRows as $key=>$row) {?>
                    <option value="<?php echo $row[0];?>" <?php if($this->vars['osName']==$row[0]){?>selected="selected"<?php }?>><?php echo $row[1];?></option>
                    <?php }?>
                </select></td>
                <td ><span id="sp_osName">*</span></td>
              </tr>
              <tr>
                <td align="right">版本号：</td>
                <td align="left"><input type="text" name="version" id="version" value="<?php echo $this->vars['version'];?>" class="input"/></td>
                <td ><span id="sp_version">*</span></td>
              </tr>
              <tr>
                <td align="right">userSign：</td>
                <td align="left"><input type="text" name="userSign" id="userSign" value="<?php echo $this->vars['userSign'];?>" class="input"/></td>
                <td ><span id="sp_userSign"></span></td>
              </tr>
              <tr>
                <td align="right">事件类型：</td>
                <td align="left"><select name="eventType" id="eventType">
                    <option value="">请选择</option>
                    <?php foreach($this->eventTypeRows as $key=>$row) {?>
                    <option value="<?php echo $row['eventId'];?>" <?php if($this->vars['eventType']==$row['eventId']){?>selected="selected"<?php }?>><?php echo $row['eventName'];?>[<?php echo $row['eventId'];?>]</option>
                    <?php }?>
                </select></td>
                <td ><span id="sp_eventType"></span></td>
              </tr>
			  <tr>
                <td align="right">参数01：</td>
                <td align="left"><input type="text" name="eventData01" id="eventData01" value="<?php echo $this->vars['eventData01'];?>" class="input"/></td>
                <td ><span id="sp_eventData01"></span></td>
              </tr>
			  <tr>
                <td align="right">排序方式：</td>
                <td align="left"><select name="eventSort" id="eventSort">
                    <option value="SORT_ASC" <?php if($this->vars['eventSort']=='SORT_ASC'){?>selected="selected"<?php }?>>升序</option>
					<option value="SORT_DESC" <?php if($this->vars['eventSort']=='SORT_DESC'){?>selected="selected"<?php }?>>降序</option>
                </select></td>
                <td ><span id="sp_eventType"></span></td>
              </tr>
			   <tr>
                <td align="right">显示记录：</td>
                <td align="left"><input type="text" name="pageSize" id="pageSize" size="4" value="<?php echo $this->vars['pageSize'] ? $this->vars['pageSize'] : 100;?>" class="input"/></td>
                <td ><span id="sp_pageSize"></span></td>
              </tr>
              <tr>
                <td align="right">&nbsp;</td>
                <td align="left"><input type="hidden" name="dateType" id="dateType" value="<?php echo $this->vars['dateType'];?>" />
                    <input type="hidden" name="doType" id="doType" value="<?php echo $this->vars['doType'];?>" />
                    <input name="search" type="button" id="search2" value="查找" class="button" onclick="selData('<?php echo $this->projectUrl(array('action'=>'index')) ;?>',6,<?php echo $this->vars['doType'];?>);"/>
                </td>
              </tr>
            </table>
				
				
				
				
			</td>
			<td width="50%" valign="top">
			<div class="event-note">
			注：事件类型=> 参数1|参数2|参数3<br/>
			<?php 
			$i =0;
			foreach($this->eventTypeRows as $key=>$row) {
				$i ++;
			?>
               <li><?php echo $i.'.';?><?php echo $row['eventName'];?>[<?php echo $row['eventId'];?>]：<?php echo $row['eventNote'];?></li>
            <?php }?>
			<div class="resultNote clear" style="padding-top:5px;"><div class="error" style=" width:10px; height:20px;"></div>：表示正则匹配出错！</div>
			</div>
			
			</td>
		  </tr>
		</table>

					
		  </form>
		</div>

		<div id="content">		
			<!--content start-->
				<div class="d-title">
				<a onclick="selData('<?php echo $this->projectUrl(array('action'=>'index')) ;?>',<?php echo $this->vars['dateType'];?>,1);" class="<?php echo $this->vars['doType']==1 ? 'on' : ''?>">数据</a> 
				<a onclick="selData('<?php echo $this->projectUrl(array('action'=>'index')) ;?>',<?php echo $this->vars['dateType'];?>,2);" class="<?php echo $this->vars['doType']==2 ? 'on' : ''?>">对照</a> 
				<div  style="clear:both;"></div>
				</div>
				<span class="d-line"></span>
				<!-- doType ==1 -->
				<?php if ($this->vars['doType']==1){ ?>
				<?php 	if(count($this->rows)>0){?>
						<table class="table reportTable">
						<tr class="subject">
							<td>事件发生时间[eventDate]</td>
							<td>userSign</td>
							<td>事件类型</td>
							<td>来源页面</td>
							<td>参数01</td>
							<td>参数02</td>
							<td>参数03</td>
						</tr>
						<?php foreach ($this->rows as $row){?>
						<tr>
							<td><?php echo $row['eventTime'];?></td>
							<td><?php echo $row['userSign'];?></td>
							<td><?php echo $row['eventId'];?></td>
							<td><?php echo $row['eventPageId'] ;?></td>
							<td><?php echo $row['eventData01']; ?></td>
							<td><?php echo $row['eventData02'];?></td>
							<td><?php echo $row['eventData03'];?></td>
							
						</tr>
						<?php }?>
						</table>
				<?php 	} else{?>
						<div class="d-none">
						暂无数据！
						</div>
				<?php	 }?>
				
				<?php }?>
				<!-- doType ==1 /-->
				
				<!-- doType ==2 -->
				<?php if ($this->vars['doType']==2){ ?>
				<?php 	if(count($this->rows)>0){?>
						<table class="table reportTable">
						<tr class="subject">
							<td>事件发生时间[eventDate]</td>
							<td>userSign</td>
							<td>事件类型</td>
							<td>来源页面</td>
							<td>参数01</td>
							<td>参数02</td>
							<td>参数03</td>
						</tr>
						<?php foreach ($this->rows as $row){?>
						<tr>
							<td><?php echo $row['eventDate'];?></td>
							<td><?php echo $row['userSign'];?></td>
							<td title="<?php echo $row['eventId'];?>"><?php echo $row['eventName'];?></td>
							<td title="<?php echo $row['eventPageId'];?>"><?php echo $row['eventPageName'] ? $row['eventPageName'] : $row['eventPageId'] ;?></td>
							<td title="<?php echo $row['eventData01'];?>">
							<?php 
								if ($row['eventId']=='1004'){
									echo $row['eventInfoName'] ? $row['eventInfoName'] : $row['eventData01'];
								} else if ($row['eventId']=='1005'){
									echo $row['eventInfoName'] ? $row['eventInfoName'] : $row['eventData01'];
								} else if($row['eventId']=='1002'){
									if (trim($row['eventData01'])=='0'){
										echo '异常';
									} else if (trim($row['eventData01'])=='1'){
										echo '后台';
									} else if (trim($row['eventData01'])=='2'){
										echo '前台';
									} else {
										echo $row['eventData01'];
									}
								} else if($row['eventId']=='1003'){
									if (trim($row['eventData01'])=='0'){
										echo '异常';
									} else if (trim($row['eventData01'])=='1'){
										echo '正常';
									} else {
										echo $row['eventData01'];
									}
								} else{
								    echo $row['eventData01'];
								}
							?></td>
							<td class="<?php if ($row['error']==1){?>error<?php } else{?><?php }?>" title="<?php echo $row['eventInfoNote'];?>"><?php echo $row['eventData02'];?></td>
							<td <?php if ($row['eventId']=='1004'){ echo "title='页面停留 {$row['eventData03']}(秒)'"; }?>><?php echo $row['eventData03'];?></td>
							
						</tr>
						<?php }?>
						</table>
				<?php 	} else{?>
						<div class="d-none">
						暂无数据！
						</div>
				<?php	 }?>
				
				<?php }?>
				<!-- doType ==2 /-->
				
				
				
				
				
				<div  class="d-note">
				
				</div>
				<!--content end-->
					
		</div>
			
			
			
			
				
				
				
				
	</div>
	</div>
</div>



<script language="javascript">
function selData(action,dateType,doType){
	if($.trim($('#expType').val())==''){
		$('#sp_expType').html("<font color='red'>*请选择开发环境！</font>");
		$("#expType").focus();
		return false;
	}
	if($.trim($('#startTime').val())==''){
		$('#sp_startTime').html("<font color='red'>*请选择日志日期！</font>");
		$("#startTime").focus();
		return false;
	}
	if($.trim($('#osName').val())==''){
		$('#sp_osName').html("<font color='red'>*请选择操作系统！</font>");
		$("#osName").focus();
		return false;
	}
	if($.trim($('#version').val())==''){
		$('#sp_version').html("<font color='red'>*请输入APP版本号！</font>");
		$("#version").focus();
		return false;
	}
	if($.trim($('#userSign').val())!='' && $.trim($('#userSign').val()).length !=32 ){
		$('#sp_userSign').html("<font color='red'>userSign输入有！</font>");
		$("#userSign").focus();
		return false;
	}
	if($.trim($('#eventData01').val())!='' && $.trim($('#eventData01').val()).length >4 ){
		$('#sp_eventData01').html("<font color='red'>如：页面id或操作id！</font>");
		$("#eventData01").focus();
		return false;
	}
	
    $('#searchForm').attr('action', action);
	$('#dateType').attr('value', dateType);
	$('#doType').attr('value', doType);
    $('#searchForm').submit();
	
}

</script>
</body>
</html>